package com.cskaoyan.service.stat;

import com.cskaoyan.mapper.MallOrderGoodsMapper;
import com.cskaoyan.mapper.MallUserMapper;
import com.cskaoyan.model.vo.stat.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: project-market
 * @description: 统计报表
 * @author: shiyue
 * @create: 2021/12/1 9:25
 **/
@Service
public class StatServiceImpl implements StatService {

    @Autowired
    MallUserMapper mallUserMapper;

    @Autowired
    MallOrderGoodsMapper mallOrderGoodsMapper;



    @Override
    public StatUserVO getUser(){
/*        Date date = null;
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        date=sdf.parse(day);*/
        List<StatUserInnerVO> list = mallUserMapper.selectCount();
        StatUserVO userVO = new StatUserVO();
        userVO.setList(list);
        return userVO;
    }

    @Override
    public StatOrderVO getOrder() {
        //TODO
        List<StatOrderInnerVO> list = mallOrderGoodsMapper.selectOrder();
        //List<StatOrderInnerVO> list = null;

        StatOrderVO userVO = new StatOrderVO();
        //System.out.println(list);
        userVO.setList(list);
        return userVO;
    }

    @Override
    public StatGoodsVO getGoods() {
        //TODO
        List<StatGoodsInnerVO> list = mallOrderGoodsMapper.selectGoods();
       // List<StatGoodsInnerVO> list = null;
        StatGoodsVO userVO = new StatGoodsVO();
        System.out.println(list);
        userVO.setList(list);
        return userVO;
    }


}
